package com.km.team.phsystem.msg;

import java.util.Random;
import java.util.concurrent.atomic.AtomicReference;

public class IdGenerator {

    public static  String genId(int length){
        final Random random = new Random(System.currentTimeMillis());
        AtomicReference<String> result = new AtomicReference<>("");
        for (int i = 0; i < length; i++) {
            result.updateAndGet(v -> v + random.nextInt(10));
        }
        return result.get();
    }
}
